<?php 
header('Content-type:text/html;charset=utf-8');
class Model{
	private static $link = NULL;
	public function __construct(){
			if(is_null(self::$link)){
				self::$link = $this->connect();
			}
	}
	public function connect(){
		echo '连接一次<br/>';
		return '资源';
	}
	public function query(){
	    echo '使用' . self::$link ."查询<br/>";
	}
}
$m = new Model;
$m ->query();
$m = new Model;
$m ->query();





 ?>